package ningbo.oop;

/**
 * @Author 宁铂
 * @Date 2021/7/8 16:43
 * @Version 1.0
 */
public class TestPrivateField {

    public static void main(String[] args) {

        Cat cat = new Cat();

        cat.setName("mimi");
        cat.getName();

    }
}

class Cat{
    private String name;

    public String getName() {
        System.out.println(name);
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}